package decoration;

/**
 *
 */
public class App {
    public static void main(String[] args) {
        //创建两种基本类型的咖啡（被装饰对象）
        Drink coffeeOne = new CoffeeOne();
        Drink coffeeTwo = new CoffeeTwo();
        //用配料作为装饰者，包装咖啡，为其加配料,可以被多个装饰者修饰
        Drink mocha = new Mocha(coffeeOne);
        Drink mocha2 = new Milk(mocha);
        System.out.println(mocha2.getDescription()+"$"+mocha2.cost());

        Drink milk = new Milk(coffeeTwo);
        System.out.println(milk.getDescription()+"$"+milk.cost());
    }
}
